//
//  MineHeaderView.m
//  YYPHSpeedJump
//
//  Created by sujiang on 16/2/23.
//  Copyright © 2016年 sujiang. All rights reserved.
//

#import "MineHeaderView.h"

@implementation MineHeaderView

- (void)awakeFromNib {
   
    self.headImage.layer.shadowColor = kColors(255, 255, 255, 1).CGColor;
    self.headImage.layer.cornerRadius = self.headImage.frame.size.width*kWidthScale / 2;
    self.headImage.layer.masksToBounds = YES;
    //self.headImage.layer.shadowOpacity = 0.71;
    self.headImage.layer.shadowRadius = 1.0;
    self.headImage.layer.borderWidth = 2.5f;
    self.headImage.layer.borderColor = kColors(255, 255, 255, 1).CGColor;
    NSTimeZone *zone = [NSTimeZone systemTimeZone];
    NSDate *date = [NSDate date];
    NSInteger interval = [zone secondsFromGMTForDate: date];
    NSDate *currentDate = [date  dateByAddingTimeInterval: interval];
   
    NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
    [formatter setDateFormat:@"HH"];
    NSString *str = [formatter stringFromDate:[NSDate date]];
    int time = [str intValue];
    NSLog(@"当前时间是%d",time);
    if (5<=time && time<9)
    {
        self.timeLable.text = @"早上好!";
        
    }else if (9<=time&&time<11)
    {
        self.timeLable.text = @"上午好!";
        
    }else if (11<=time&&time<14)
    {
        self.timeLable.text = @"中午好!";
        
    }else if (14<=time&&time<18)
    {
        self.timeLable.text = @"下午好!";
    }

    else
    {
        self.timeLable.text = @"晚上好!";
    }
}

@end
